Skip to content

Require Python 3.11 and adopt native typing and diagnostics - #186

Merged
hallerite merged 3 commits into
mainfrom
codex/drop-python-310
Oct 9, 2026
Merged

hallerite merged 3 commits into
mainfrom
codex/drop-python-310

Conversation

@hallerite

@hallerite hallerite commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Require Python 3.11 or newer while retaining support through Python 3.14. Update CI, standalone examples, and the lockfile to remove Python 3.10-only dependency resolutions and backports.

Use the new baseline to improve typing and diagnostics:

  • Mark Message.role and Message.content as Required, including correct runtime TypedDict metadata.
  • Annotate all 15 config validators that return their instance with Self.
  • Use StrEnum for ToolCallParseStatus: str(status) now returns its wire value (for example, "invalid_json"); values and JSON serialization remain unchanged.
  • Add tokenizer/model and renderer context to loading and construction errors with add_note(), preserving the original exception object, message, and traceback.

Validation: 125 passed, 6 skipped in the focused Python 3.13 suite; both retained regression tests pass on Python 3.11. Pre-commit lint/format checks pass; the type-check gate passes with 63 advisory diagnostics. The full model parity suite was not rerun for this update.


Note

Medium Risk
Raising the minimum Python version is a breaking change for 3.10 users; runtime behavior is unchanged but install and CI coverage shift to 3.11–3.14 only.

Overview
Drops Python 3.10 now that it is EOL and requires Python 3.11+ (still capped below 3.15).

requires-python in pyproject.toml moves from >=3.10 to >=3.11. The GitHub Actions test matrix no longer runs on 3.10. All four uv run --script example headers under examples/ use >=3.11,<3.14.

uv.lock is regenerated for the new floor: dual-resolution markers and Python 3.10-only wheels/backports (e.g. exceptiongroup, tomli, backports-asyncio-runner, older numpy/networkx pins) are removed.

Reviewed by Cursor Bugbot for commit acd9f3a. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Require Python 3.11 and adopt native typing and better error diagnostics

  • Raises the minimum Python from 3.10 to 3.11 in pyproject.toml, the example scripts, and the CI test matrix in test.yml
  • Refactors base.py to Python 3.11 typing: ToolCallParseStatus now uses StrEnum, Message.role and Message.content become required keys via Required[...], and the module drops postponed-annotation setup
  • Annotates Pydantic validators with Self in configs.py; validation logic is unchanged
  • load_tokenizer and create_renderer in base.py now add exception notes naming the tokenizer or renderer before re-raising
  • Adds tests covering ToolCallParseStatus wire values and Message required/optional keys
  • Risk: behavioral change — Python 3.10 is now unsupported at install and runtime, and ToolCallParseStatus string conversion and JSON encoding use the member's wire value

Macroscope summarized cb53305.

@hallerite
hallerite marked this pull request as ready for review October 9, 2026 09:08
@macroscopeapp

macroscopeapp Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The code and typing updates are localized and tested, but the package and standalone examples deliberately drop Python 3.10 support, creating a user-visible compatibility break. That broader support-policy change should receive human review.

Notes:

  • Macroscope's correctness review did not run, so approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 9, 2026
@hallerite hallerite changed the title build: require Python 3.11 or newer Require Python 3.11 and adopt native typing and diagnostics Oct 9, 2026
@hallerite
hallerite merged commit 376f54f into main Oct 9, 2026
11 checks passed
@hallerite
hallerite deleted the codex/drop-python-310 branch October 9, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants